package com.zf.spring.microservice.zuul.common.filters;

import com.netflix.zuul.ZuulFilter;

public class FilterInfo {
	private String filterKey;
	private String filterType;
	private int filterOrder;
	private boolean staticFilter;
	private String disablePropertyName;
	private boolean filterDisabled;

	
	/**
	 * @return the filterKey
	 */
	public String getFilterKey() {
		return filterKey;
	}



	/**
	 * @param filterKey the filterKey to set
	 */
	public void setFilterKey(String filterKey) {
		this.filterKey = filterKey;
	}



	/**
	 * @return the filterType
	 */
	public String getFilterType() {
		return filterType;
	}



	/**
	 * @param filterType the filterType to set
	 */
	public void setFilterType(String filterType) {
		this.filterType = filterType;
	}



	/**
	 * @return the filterOrder
	 */
	public int getFilterOrder() {
		return filterOrder;
	}



	/**
	 * @param filterOrder the filterOrder to set
	 */
	public void setFilterOrder(int filterOrder) {
		this.filterOrder = filterOrder;
	}


	/**
	 * @return the disablePropertyName
	 */
	public String getDisablePropertyName() {
		return disablePropertyName;
	}

	/**
	 * @param disablePropertyName the disablePropertyName to set
	 */
	public void setDisablePropertyName(String disablePropertyName) {
		this.disablePropertyName = disablePropertyName;
	}


	/**
	 * @return the staticFilter
	 */
	public boolean isStaticFilter() {
		return staticFilter;
	}



	/**
	 * @param staticFilter the staticFilter to set
	 */
	public void setStaticFilter(boolean staticFilter) {
		this.staticFilter = staticFilter;
	}



	/**
	 * @return the filterDisabled
	 */
	public boolean isFilterDisabled() {
		return filterDisabled;
	}



	/**
	 * @param filterDisabled the filterDisabled to set
	 */
	public void setFilterDisabled(boolean filterDisabled) {
		this.filterDisabled = filterDisabled;
	}



	public static FilterInfo convertZuulFilter(String key, ZuulFilter zuulFilter){
		FilterInfo filterInfo = new FilterInfo();
		filterInfo.setFilterKey(key);
		filterInfo.setDisablePropertyName(zuulFilter.disablePropertyName());
		filterInfo.setFilterOrder(zuulFilter.filterOrder());
		filterInfo.setFilterType(zuulFilter.filterType());
		filterInfo.setFilterDisabled(zuulFilter.isFilterDisabled());
		filterInfo.setStaticFilter(zuulFilter.isStaticFilter());
		return filterInfo;
	}
	
	
}
